The dissociative recombination (DR) of the AB(+) molecular ion with an electron has been shown to be an important component in the detailed interpretation of planetary ionosphere data. A first principles theoretical approach is developed for calculating the DR cross sections and rates for AB(+) molecular ions. The calculations focus on O2(+) and N2(+) DR, and are the first to include the indirect DR mechanism (Ryberg vibrational levels below v = 0 level of ion) for a molecule larger than H2(+). The importance of electron capture width in calculating the cross sections and rates is also examined. Electron capture widths are given for all states of O2 that are of importance to DR (lowest 10 vibrational levels of ion). Knowledge of the details of dissociative recombination will be needed for interpretation of data from future interplanetary and comet atmospheric studies.